from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy.sql import select
from sqlalchemy import create_engine

engine = create_engine('sqlite:///instance/alpha_scores.db')
base = automap_base()
base.prepare(engine, reflect=True)
alpha = base.classes.tb_alpha_score
session = Session(engine)
query = select(alpha).where(alpha.account == 'xy')
result = session.execute(query)
for row, in result:
    print(row.id, row.account, row.date, row.balance)
